Optimal. Leaf size=119 \[ \frac{2 c^2 \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{a \sec (e+f x)+a}}\right )}{\sqrt{a} f}-\frac{4 \sqrt{2} c^2 \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{2} \sqrt{a \sec (e+f x)+a}}\right )}{\sqrt{a} f}+\frac{2 c^2 \tan (e+f x)}{f \sqrt{a \sec (e+f x)+a}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.18764, antiderivative size = 119, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.179, Rules used = {3904, 3887, 479, 522, 203} \[ \frac{2 c^2 \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{a \sec (e+f x)+a}}\right )}{\sqrt{a} f}-\frac{4 \sqrt{2} c^2 \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{2} \sqrt{a \sec (e+f x)+a}}\right )}{\sqrt{a} f}+\frac{2 c^2 \tan (e+f x)}{f \sqrt{a \sec (e+f x)+a}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3904
Rule 3887
Rule 479
Rule 522
Rule 203
Rubi steps
\begin{align*} \int \frac{(c-c \sec (e+f x))^2}{\sqrt{a+a \sec (e+f x)}} \, dx &=\left (a^2 c^2\right ) \int \frac{\tan ^4(e+f x)}{(a+a \sec (e+f x))^{5/2}} \, dx\\ &=-\frac{\left (2 a^2 c^2\right ) \operatorname{Subst}\left (\int \frac{x^4}{\left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac{\tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{f}\\ &=\frac{2 c^2 \tan (e+f x)}{f \sqrt{a+a \sec (e+f x)}}+\frac{\left (2 c^2\right ) \operatorname{Subst}\left (\int \frac{2+3 a x^2}{\left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac{\tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{f}\\ &=\frac{2 c^2 \tan (e+f x)}{f \sqrt{a+a \sec (e+f x)}}-\frac{\left (2 c^2\right ) \operatorname{Subst}\left (\int \frac{1}{1+a x^2} \, dx,x,-\frac{\tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{f}+\frac{\left (8 c^2\right ) \operatorname{Subst}\left (\int \frac{1}{2+a x^2} \, dx,x,-\frac{\tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{f}\\ &=\frac{2 c^2 \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{\sqrt{a} f}-\frac{4 \sqrt{2} c^2 \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{2} \sqrt{a+a \sec (e+f x)}}\right )}{\sqrt{a} f}+\frac{2 c^2 \tan (e+f x)}{f \sqrt{a+a \sec (e+f x)}}\\ \end{align*}
Mathematica [A] time = 0.475033, size = 124, normalized size = 1.04 \[ \frac{2 c^2 \cot \left (\frac{1}{2} (e+f x)\right ) \sec (e+f x) \left (-\cos (e+f x)+\cos (e+f x) \sqrt{\sec (e+f x)-1} \tan ^{-1}\left (\sqrt{\sec (e+f x)-1}\right )-2 \sqrt{2} \cos (e+f x) \sqrt{\sec (e+f x)-1} \tan ^{-1}\left (\frac{\sqrt{\sec (e+f x)-1}}{\sqrt{2}}\right )+1\right )}{f \sqrt{a (\sec (e+f x)+1)}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.277, size = 330, normalized size = 2.8 \begin{align*}{\frac{{c}^{2}}{af \left ( 1+\cos \left ( fx+e \right ) \right ) } \left ( -\sqrt{2}\cos \left ( fx+e \right ) \sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}{\it Artanh} \left ({\frac{\sqrt{2}\sin \left ( fx+e \right ) }{2\,\cos \left ( fx+e \right ) }\sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}} \right ) -4\,\cos \left ( fx+e \right ) \sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}\ln \left ({\frac{1}{\sin \left ( fx+e \right ) } \left ( \sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}\sin \left ( fx+e \right ) -\cos \left ( fx+e \right ) +1 \right ) } \right ) -\sqrt{2}\sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}{\it Artanh} \left ({\frac{\sqrt{2}\sin \left ( fx+e \right ) }{2\,\cos \left ( fx+e \right ) }\sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}} \right ) -4\,\sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}\ln \left ({\frac{1}{\sin \left ( fx+e \right ) } \left ( \sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}\sin \left ( fx+e \right ) -\cos \left ( fx+e \right ) +1 \right ) } \right ) +2\,\sin \left ( fx+e \right ) \right ) \sqrt{{\frac{a \left ( 1+\cos \left ( fx+e \right ) \right ) }{\cos \left ( fx+e \right ) }}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.75899, size = 1138, normalized size = 9.56 \begin{align*} \left [\frac{2 \, c^{2} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right ) + 2 \, \sqrt{2}{\left (a c^{2} \cos \left (f x + e\right ) + a c^{2}\right )} \sqrt{-\frac{1}{a}} \log \left (\frac{2 \, \sqrt{2} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sqrt{-\frac{1}{a}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, \cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1}\right ) -{\left (c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \sqrt{-a} \log \left (\frac{2 \, a \cos \left (f x + e\right )^{2} + 2 \, \sqrt{-a} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right )}{a f \cos \left (f x + e\right ) + a f}, \frac{2 \,{\left (c^{2} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right ) -{\left (c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \sqrt{a} \arctan \left (\frac{\sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt{a} \sin \left (f x + e\right )}\right ) + \frac{2 \, \sqrt{2}{\left (a c^{2} \cos \left (f x + e\right ) + a c^{2}\right )} \arctan \left (\frac{\sqrt{2} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt{a} \sin \left (f x + e\right )}\right )}{\sqrt{a}}\right )}}{a f \cos \left (f x + e\right ) + a f}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} c^{2} \left (\int - \frac{2 \sec{\left (e + f x \right )}}{\sqrt{a \sec{\left (e + f x \right )} + a}}\, dx + \int \frac{\sec ^{2}{\left (e + f x \right )}}{\sqrt{a \sec{\left (e + f x \right )} + a}}\, dx + \int \frac{1}{\sqrt{a \sec{\left (e + f x \right )} + a}}\, dx\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]